import React, { useState } from 'react'
import { Form, Input, Button, Card } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import BraftEditor from 'braft-editor'
import 'braft-editor/dist/index.css'

export default () => {

    const [val, setVal] = useState(BraftEditor.createEditorState(null))

    return (
        <PageHeaderWrapper title={false}>
            <Card>
                <Form
                    labelCol={{ span: 3 }}
                    wrapperCol={{ span: 15 }}
                >
                    <Form.Item label="入驻协议" required>
                        <Input />
                    </Form.Item>

                    <Form.Item label="协议内容" required>
                        <BraftEditor
                            value={val}
                            onChange={() => {

                            }}
                            onSave={() => {

                            }}
                            style={{ border: '1px solid #d1d1d1' }}
                        />
                    </Form.Item>
                    <Form.Item wrapperCol={{ offset: 3 }}>
                        <Button type="primary">保存</Button>
                    </Form.Item>
                </Form>
            </Card>
        </PageHeaderWrapper>
    )
}